<meta charset="utf-8">
<script>
    var str = "1007551710@qq.com";
    //alert(str.substring(str.length-1));
    var weishi = str.indexOf("@");
    alert(str.substring(0,weishi));
</script>